-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Nest handoff history by default #1996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nest handoff history by default #1996
Conversation
rm-openai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of kaz's feedback seems right. In addition, I'd say two major things:
- This setting should be on the
Handoffobject - Since you're updating the default, this is a breaking change, so please update the changelog.
jhills20
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to Handoff, added handoff history .py file for non extension parts of handoff filter, added changelog
docs/release.md
Outdated
| - By default handoff history is now packaged into a single assistant message instead of exposing the raw user/assistant turns, giving downstream agents a concise, predictable recap | ||
| - The existing single-message handoff transcript now by default starts with "For context, here is the conversation so far between the user and the previous agent:" before the `<CONVERSATION HISTORY>` block, so downstream agents get a clearly labeled recap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we;ve release 0.5.0 so you'll need to move this to a 0.6.0 section
| filter_name = getattr(input_filter, "__qualname__", repr(input_filter)) | ||
| from_agent = getattr(agent, "name", agent.__class__.__name__) | ||
| to_agent = getattr(new_agent, "name", new_agent.__class__.__name__) | ||
| logger.debug( | ||
| "Filtering handoff inputs with %s for %s -> %s", | ||
| filter_name, | ||
| from_agent, | ||
| to_agent, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird syntax - also can you use f-strings and get rid of getattr?
| __all__ = [ | ||
| "remove_all_tools", | ||
| "nest_handoff_history", | ||
| "default_handoff_history_mapper", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this, not super useful
Summary
nest_handoff_historyflag toRunConfigand call a new helper that condenses the prior transcript into a developer-role summary when handing offTesting
uv run pytest tests/test_extension_filters.pyuv run pytest tests/test_agent_runner.py -k handoffuv run pytest tests/test_agent_runner_streamed.py -k handoffhttps://chatgpt.com/codex/tasks/task_i_68ff73bda0f4832496f3d1fa9103905f